package com.guang.springbootrequestversion.controller;

import com.guang.springbootrequestversion.bean.User;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liguang
 * @date 2022/5/16 9:29
 */
@Controller
@RequestMapping(path = "user")
public class UserController {

    @ResponseBody
    @RequestMapping(path = "hello",consumes = MediaType.APPLICATION_JSON_VALUE,produces = MediaType.APPLICATION_JSON_VALUE)
    public User hello(@RequestBody User user){
        System.out.println("对应的user的属性是："+user);
        return user;
    }

}
